package cn.lingyangwl.agile.pay.model.entity;

import cn.lingyangwl.agile.model.BasePO;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * 支付节点, 比如 用户发起支付(第一个节点)->支付回调成功或者失败(第二个节点)->用户退款或者退款失败(第三个节点)
 * @author shenguangyang
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("pm_pay_node")
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class PayNode extends BasePO implements Serializable {

    public static LambdaQueryWrapper<PayNode> lqw() {
        return Wrappers.lambdaQuery();
    }

    private Long id;

    /**
     * 节点标题
     */
    private String titleCode;

    /**
     * 创建者用户id
     */
    private Long createdUid;

    /**
     * 支付订单号
     * @see PayOrder#getPayOrderNo()
     */
    private String payOrderNo;


    @TableField(fill = FieldFill.INSERT)
    private Date createdAt;
}
